
define(['app'],function (app) {
    app.controller('groupmsgCtrl', ['$scope','$ionicPopup', function($scope, $ionicPopup) {
      $scope.asd = 3;
        // Triggered on a button click, or some other target
        $scope.addcomment = function() {
            $scope.data = {}
            var myPopup = $ionicPopup.show({
                template: '<input type="text" ng-model="data.comment">',
                title: '添加评论',
                scope: $scope,
                buttons: [
                    { text: '取消' },
                    {
                        text: '<b>保存</b>',
                        type: 'button-positive',
                        onTap: function(e) {
                            return $scope.data.comment;
                        }
                    }
                ]
            });
            myPopup.then(function(res,$scope) {
                console.log('Tapped!', res);
                var comment='<li style="padding: 0;margin-bottom: .5rem; margin-left:.5rem; position: relative;border-bottom: 1px solid lightgray;">'+
                '<img src="img/perry.png" style="position: absolute;top: 0px;left: 0px; width: 32px;height: 32px;border-radius: 32px;">'+
                '<span style="line-height: 32px;left: 50px;top: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zauberber：'+res+'</span>'+
              '</li>';
              angular.element(list).append(comment);
            });
            var a = angular.element(asd).innerHTML;
            console.log(a);
          angular.element(asd).innerHTML =a+1;
        };

    }]);
});
